package com.lm.jsoup.example;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class JsoupFromString {
    public static void main(String[] args) {
        String html = "<html><head><title>Jsoup Example</title></head>" +
                "<body><p>Hello, Jsoup!</p></body></html>";

        // 解析 HTML 字符串
        Document document = Jsoup.parse(html);

        // 输出标题和段落内容
        System.out.println("Title: " + document.title());
        System.out.println("Body Text: " + document.body().text());
    }
}
